package com.czf.testmodule.annotation;


import com.alibaba.fastjson.JSON;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zfChen
 * @create 2022/6/30 13:48
 */
@RestController
@Data
@Slf4j
public class Student {

    private String name;

    //    @CherryAnnotation("注解的值")
    @RequestMapping("/study")
    @LogRqRp("咬合垫排版")
    public int study(Integer times) {
        System.out.println("study方法：" + times);
        try {
            int a = 1 / 0;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return 1001;
    }

//    public static void main(String[] args) throws NoSuchMethodException {
//        boolean annotationPresent = Student.class.getDeclaredMethod("study", int.class).isAnnotationPresent(CherryAnnotation.class);
//        if (annotationPresent) {
//            CherryAnnotation annotation = Student.class.getDeclaredMethod("study", int.class).getAnnotation(CherryAnnotation.class);
//            System.out.println(annotation.age());
//            System.out.println(annotation.name());
//        }
//    }
}
